package learn_concurrent.t99;

public class RunThread extends Thread {
	private volatile boolean isRunning = true;

	public boolean isRunning() {
		return isRunning;
	}

	public void setRunning(boolean isRunning) {
		this.isRunning = isRunning;
	}
	
	@Override
	public void run() {
		System.out.println("���� run ��");
		while (isRunning) {
			
		}
		System.out.println("�̱߳�ֹͣ��");
	}
	
	public static void main(String[] args) throws Exception {
		RunThread runThread = new RunThread();
		runThread.start();
		Thread.sleep(1000);
		runThread.setRunning(false);
		System.out.println("�Ѿ���ֵΪ false ");
	}
}
